﻿using System;
using System.Linq;
using System.Collections.Generic;
namespace Spotless.Data.DataAccess.Interfaces
{
    public interface IQueryRepository : IBaseRepository
    {
        void AddQuery(Spotless.Data.Query query);
        IQueryable<Category> Category_GetAll();
        Category Category_GetById(int id);
        DrillDown DrillDown_GetById(int id);
        IQueryable<DrillDown> DrillDown_GetTopLevelByCategoryId(int categoryId, byte typeId);
        IQueryable<DrillDown> DrillDown_GetAllByParentId(int id);
        IQueryable<DrillDown> DrillDown_GetAllByParentId(int id, byte typeId);
        
        Spotless.Data.Query Query_GetById(int id);
        IQueryable<Query> Query_GetAll();
        IQueryable<Query> Query_GetOpen();
        IQueryable<Query> Query_GetCompleted();
        IQueryable<Query> Query_GetOpenApprovedCompensation();
        IQueryable<Query> Query_GetOpenDeclinedCompensation();
        
        IQueryable<Query> Query_GetPendingCompensation();
        IQueryable<Query> Query_GetPendingCompensationForUser(string userName);

        int Query_CountAll();
        int Query_CountAllCompleted();
        float Query_CountCompletedCompensation();

        void Query_ApproveCompensation(int id);
        
        //
        //CUSTOMERS
        IQueryable<Customer> Customer_GetAll();
        
        void AddCustomer(Spotless.Data.Customer customer);

        Spotless.Data.Customer Customer_GetById(int id);
        
        //
        //CAMPAIGNS
        //IQueryable<Query> Campaign_GetOpen();
        IQueryable<Campaign> Campaign_GetAll();


        Spotless.Data.Campaign Campaign_GetById(int id);

        IQueryable<Campaign> Campaign_GetByIdList(int id);
        
        //IQueryable<CampaignUser> Campaign_Recipients(int id);
        //Spotless.Data.Campaign Campaign_Recipients(int id);
        
        
        void AddCampaign(Spotless.Data.Campaign campaign);

        //CAMPAIGNUSER
        IQueryable<CampaignUser> CampaignUser_Recipients(int id);

        IQueryable<CampaignUser> CampaignUser_GetAll();

        IQueryable<DetailedReport> DetailedReport_Search(DateTime? from, DateTime? to, int[] categoryIDs, int[] productIDs);

        IQueryable<ComplaintsAlert> ComplaintsAlert_GetAllFormUser(string username);

        aspnet_User AspNetUser_GetByName(string username);

        void AddComplaintsAlert(ComplaintsAlert item);

        void DeleteComplaintsAlert(ComplaintsAlert item);
    }
}